var app = angular.module("app", []);
// app.config(function ($routeProvider) {
//     $routeProvider
//         .when(
//             "/default",
//             {
//                 controller: loginCtrl,
//                 templateUrl: "../../templates/default.html"
//             }
//         )
//         .when(
//             "/defect",
//             {
//                 controller: defectCtrl,
//                 templateUrl: "../../templates/defect.html"
//             }
//         )
//         .when(
//             "/user",
//             {
//                 controller: userCtrl,
//                 templateUrl: "../../templates/user.html"
//             }
//         )
//         .when(
//             "/thirdpart",
//             {
//                 controller: projectCtrl,
//                 templateUrl: "../../templates/thirdpart.html"
//             }
//         )
//         .when(
//             "/about",
//             {
//                 controller: aboutCtrl,
//                 templateUrl: "../../templates/about.html"
//             }
//         )
//         // .otherwise(
//         //     {
//         //         redirectTo: "/"
//         //     }
//         // )
// });

app.value("defaultRank", [
    "一般",
    "普通",
    "重要",
    "紧急",
    "非常紧急"
]);
app.value(
    "defaultImg", "" +
    "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"
);

app.filter("reverse", function (defaultRank) {
    return function (rank) {
        return defaultRank[rank - 1];
    }
});
// app.filter("replace", function () {
//     return function (string) {
//         return string.replace("<br/>", "\n");
//     }
// });


function restResult(resp, callback) {
    if (resp.data.code === 1) {
        if (typeof callback === 'function') {
            callback(resp.data.data);
        } else if (resp.data.msg !== null) {
            alert(resp.data.msg);
        } else {
            alert("操作成功！");
        }
    } else {
        alert(resp.data.msg);
    }
}